﻿using System;
using System.Collections.Generic;
using System.Text;

namespace 作业
{
    class Employee
    {
        //          1，雇员系统，定义雇员基类，共同的属性，姓名、地址和出生日期(可有可无)，
        //          子类：程序员，秘书，高层管理，清洁工，他们有不同的工资算法，
        //      其中高级主管和程序员采用底薪加提成的方式，高级主管和程序员的底薪分别是5000元和2000元 ，
        //             秘书和清洁工采用工资的方式，工资分别是3000和1000，以多态的方式处理程序。
        protected string name { get; set; }
        protected string site { get; set; }
        protected string brithdaytime { get; set; }
        protected double totalwages { get; set; }//总工资
       protected  string _wagealgorithm;//工资算法
        
        public Employee(string wagealgorithm)
        {
            this._wagealgorithm = wagealgorithm;
          
        }


    }
    class Executive : Employee//高层管理
    {
        double _basic;//底薪
         double _royalty;//提成
        public Executive(double basic, string wagealgiruthm, double royalty) : base(wagealgiruthm)
        {
            this._basic = basic;
            this._royalty = royalty;
        }
        public void way()
        {
            name = "高级主管";
            site = "阿里妈妈";
            brithdaytime ="1997-10-6";
            totalwages = _basic * _royalty+_basic ;
            Console.WriteLine("姓名:{0}\n地址:{1}\n出生日期:{2}\n工资算法:{3}\n总工资:{4}\n",name , site, brithdaytime , _wagealgorithm,totalwages );
            
        }
        public void way1()
        {
            name = "程序员";
            site = "阿里爸爸";
            brithdaytime = "1999-11-6";
            totalwages = _basic * _royalty + _basic;
            Console.WriteLine("姓名:{0}\n地址:{1}\n出生日期:{2}\n工资算法:{3}\n总工资:{4}\n", name, site, brithdaytime, _wagealgorithm, totalwages);
        }
        }
    class secretary : Employee//秘书
    {
        double _salary;
        public secretary(double salary, string wagealgiruthm) : base(wagealgiruthm)
        {
            this._salary = salary;
        }
        public void way()
        {
            name = "秘书";
            site = "阿里妈妈";
            brithdaytime = "1997-10-6";
            
            Console.WriteLine("姓名:{0}\n地址:{1}\n出生日期:{2}\n工资算法:{3}\n总工资:{4}\n", name, site, brithdaytime, _wagealgorithm, _salary);
           
        }
        public void way1()
        {
            name = "清洁工";
            site = "阿里爸爸";
            brithdaytime = "1999-11-6";

            Console.WriteLine("姓名:{0}\n地址:{1}\n出生日期:{2}\n工资算法:{3}\n总工资:{4}\n", name, site, brithdaytime, _wagealgorithm, _salary);
        }
        }
}
